<template>
  <div class="container">
    <div class="row">
      <div class="col-sm-12 col-md-12 col-lg-3">
        <Sidebar />
        <!-- <Aside /> -->
      </div>
      <div class="col-sm-12 col-md-12 col-lg-9">
        <!-- 路由替换 -->
        <div v-if="$store.getters.GetLoading">
          <div
            style="margin-top: 25%"
            v-loading="$store.getters.GetLoading"
          ></div>
        </div>
        <router-view v-else />
      </div>
    </div>
  </div>
</template>

<script>
import Sidebar from "./components/Sidebar.vue";
export default {
  components: { Sidebar },
  name: "Home",
  data() {
    return {
      uid: localStorage.getItem("UID"),
      loading: this.$store.GetLoading,
    };
  },
  watch: {
    loading() {
      console.log(this.loading);
    },
  },
  // created() {
  //   // 监听浏览器刷新
  //   window.addEventListener("beforeunload", () => {
  //     // sessionStorage.setItem(
  //     //   "USERINFO",
  //     //   JSON.stringify(this.$store.state.user)
  //     // );
  //     this.$store.dispatch("GetUserInfo");
  //   });
  // },
  methods: {},
};
</script>

<style>
</style>